<?php

/**
 * banner form.
 *
 * @package    istmo
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class bannerForm extends BasebannerForm {

    public function configure() {

        $imagen_banner = '/uploads/contenidos/banner/' . $this->getObject()->imagen_banner;

        $this->widgetSchema['imagen_banner'] = new sfWidgetFormInputFileEditable(array(
            'label' => 'Imagen para el banner',
            'file_src' => $imagen_banner,
            'is_image' => true,
            'edit_mode' => !$this->isNew(),
            'template' => '<style>.fix img{max-width:200px; display:block;}</style><div class="fix">%file%</div><br />%input%<br />',
            'delete_label' => 'Borrar imagen'));

        $this->validatorSchema['imagen_banner'] = new sfValidatorFile(array(
            'required' => $this->isNew(),
            'path' => sfConfig::get('sf_upload_dir') . '/contenidos/banner/',
            'mime_types' => 'web_images',
        ));

        $imagen_descripcion = '/uploads/contenidos/banner/' . $this->getObject()->imagen_descripcion;
        $this->widgetSchema['imagen_descripcion'] = new sfWidgetFormInputFileEditable(array(
            'label' => 'Imagen para la descripción',
            'file_src' => $imagen_descripcion,
            'is_image' => true,
            'edit_mode' => !$this->isNew(),
            'template' => '<style>.fix img{max-width:200px; display:block;}</style><div class="fix">%file%</div><br />%input%<br />',
            'delete_label' => 'Borrar imagen'));

        $this->validatorSchema['imagen_descripcion'] = new sfValidatorFile(array(
            'required' => $this->isNew(),
            'path' => sfConfig::get('sf_upload_dir') . '/contenidos/banner/',
            'mime_types' => 'web_images',
        ));

        $this->widgetSchema['contenido_articulo'] = new sfWidgetFormTextareaTinyMCE(array(
            'width' => 550,
            'height' => 350,
            'config' => 'theme_advanced_disable: "anchor,image,cleanup,help"',
        ));

        $this->widgetSchema['titulo_banner1'] = new sfWidgetFormTextarea(array(
        ));

        $this->widgetSchema['titulo_banner2'] = new sfWidgetFormTextarea(array(
        ));
        
        //$cultures = array('es');
        //$this->embedI18n($cultures);



    }

}
